/**
 * This is the PerformeProjects Interface.
 * It's containes business logic declarations.
 * The logic methods are implemented on the
 * PerformeProjects class.
 * 
 * @author SIDIBE Tididiane
 */
package com.teamreinforce.ejb.model;

import com.teamreinforce.ejb.entities.Collaborateur;
import com.teamreinforce.ejb.entities.Etape;
import com.teamreinforce.ejb.entities.Projet;
import com.teamreinforce.ejb.entities.Tache;
import java.util.List;
import javax.ejb.Remote;

@Remote
public interface  IPerformeProjects {
    
    /**
     * This method creates a new project
     * @param title
     * @param description
     * @param dateDebut
     * @param dateFin
     * @return 
     */
    public Projet getProject(String titre);
    public Projet createProject (String title, String description, String dateDebut, String dateFin);
    
    /**
     * Gets a project by the title value
     * @param title
     * @return 
     */
    public Projet getProjectByTitle (String title);
    /**
     * Add add a step to the existant projet
     * @param project
     * @param libelle
     * @param description
     * @param dateDebut
     * @param dateFin 
     */
    public Etape addStepToProject (Projet project, String libelle, String description, String dateDebut, String dateFin);
    
    /**
     * Add a task to the step
     * @param step
     * @param libelle
     * @param description
     * @param dateDebut
     * @param dateFin 
     */
    public Tache addTaskToStep (Etape step, String libelle, String description, String dateDebut, String dateFin);
    /**
     * That method adds a collaborator to the specified projet
     * with the specified role name.
     * 
     * @param project 
     * @param collaborator
     * @param roleName 
     */
    public void addCollaboratorToProject(Projet project, Collaborateur collaborator , String roleName);
    /**
     * Adds a risk to the specified projet.
     * @param project
     * @param risque
     * @param probalilite
     * @param impact
     * @param planB 
     */
    public void addRisqueToProject (Projet project, String risque, int probalilite, String impact, String planB);
    
    /**
     * Updates the task advencement.
     * This has to be done by the 
     * collaborator who is assigned 
     * to the task
     * 
     * @param task
     * @param avencement 
     */
    public void updateTaskAdvencement (Tache task, int avencement);
    
    /**
     * That method revokes the given role from the
     * collaborator on the specified project
     * @param project
     * @param collaborator
     */
    public void removeCollaboratorFromProject (Projet project, Collaborateur collaborator);
    
    /**
     * 
     * @param project
     * @param collaborator
     * @param newRoleName 
     */
    public void updateCollaboratorRole (Projet project, Collaborateur collaborator, String newRoleName);
    
    /**
     * Assigns a task to the collaborator
     * @param collaborator
     * @param task 
     */
    public void assignTaskToCollaborator (Collaborateur collaborator, Tache task);
    
    /**
     * Removes the from him
     * @param collaborator
     * @param task 
     */
    public void removeTaskFromCollaborator (Collaborateur collaborator, Tache task);
    
    /**
     * 
     * @param pid
     * @return 
     */
    public Projet getProjetById(int pid);
    /**
     * Get all the projects
     * @return 
     */
    public List<Projet> getAllProjects ();
}
